package cn.intotw.pp.client.core;

import cn.intotw.pp.decode.MessageDecoder;
import cn.intotw.pp.decode.PPProtocolDecoder;
import cn.intotw.pp.encode.PPProtocolEncoder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * @author Chenxiang
 * @Description:
 * @create 2018/8/21 14:51
 */
public class PPClientChannelInitializer extends ChannelInitializer<NioSocketChannel> {
    protected void initChannel(NioSocketChannel nioSocketChannel) throws Exception {
        nioSocketChannel.pipeline()
                .addLast(new PPProtocolEncoder())
                .addLast(new PPProtocolDecoder(2048))
                .addLast(new PPClientHandler());
    }
}